package model

import (
	"time"

	"gddgame.cc/galaxy/common/namespaces/cooperate"
)

const SettingDirectName = "setting_direct"

type SettingDirect struct {
	Id       int               `json:"id" orm:"auto" sql:"INT"`
	Name     map[string]string `json:"name" sql:"JSON"`
	Desc     map[string]string `json:"desc" sql:"JSON"`
	Icon     string            `json:"icon" sql:"VARCHAR"`
	IconType string            `json:"icon_type" sql:"VARCHAR"`

	Range          byte            `json:"range" sql:"TINYINT"`
	MaxDistance    byte            `json:"max_distance" sql:"TINYINT"`
	AutoMove       bool            `json:"auto_move" sql:"TINYINT"`
	CoolTime       float32         `json:"cool_time" sql:"FLOAT"`      // 冷却时间
	ReadyTime      float32         `json:"ready_time" sql:"FLOAT"`     // 准备释放
	CastTime       float32         `json:"cast_time" sql:"FLOAT"`      // 释放时间
	SustainedTime  float32         `json:"sustained_time" sql:"FLOAT"` // 持续时间
	IntervalTime   float32         `json:"interval_time" sql:"FLOAT"`  // 间隔时间
	Multi          byte            `json:"multi" sql:"TINYINT"`        // 多攻击目标
	TargetIdentity []int           `json:"target_identity" sql:"JSON"` // 目标身份
	OperationId    int             `json:"operation_id" sql:"INT"`
	CoolSave       bool            `json:"cool_save" sql:"TINYINT"`
	CancelDestroy  bool            `json:"cancel_destroy" sql:"TINYINT"`
	Sustain        *SustainSetting `json:"sustain_setting" sql:"JSON"`

	EffectText ShowTextSlice `json:"effect_text" sql:"JSON"`

	TargetSelect []TargetSelect `json:"target_select" sql:"JSON"`
	Mode         DirectMode     `json:"mode" sql:"TINYINT"`
	TargetMode   TargetMode     `json:"target_mode" sql:"TINYINT"`

	ScheduleType cooperate.LogicType `json:"schedule_type" sql:"INT"`
	Params       []string            `json:"params" sql:"JSON"`
	Default      []interface{}       `json:"default" sql:"JSON"`

	Define      int `json:"define" sql:"INT"`
	DefineLevel int `json:"define_level" sql:"INT"`

	UpdateTime *time.Time `json:"update_time" orm:"updateTime" sql:"DATETIME"`
}
